package two;

import java.util.Scanner;

public class test9714 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int M = scanner.nextInt();
        int N = scanner.nextInt();
        long sum = f(M,N);
        System.out.println(sum);
    }
    private static long f(int n, int m)
    {
        if(n<1||m<1)
            return 0;
        if(n==1||m==1)
            return 1;
        if(n<m)
            return f(n,n);
        if(n==m)
            return f(n,m-1)+1;
        return  f(n,m-1)+f(n-m,m);
    }

}
